#!/bin/bash

# 获取当前目录
CURRENT_DIR=$(pwd)

# 设置 PYTHONPATH
export PYTHONPATH=$CURRENT_DIR

# 定义常量参数
ETH_PROTOCOL="http"
ETH_HOST="172.27.244.201"
ETH_PORT="8546"
IPFS_HOST="172.27.244.201"
IPFS_PORT="5001"
LEARNING_RATE="0.001"
BATCH_SIZE="32"
MIN_MEMBERS="2"
DATASET_PATH="fl/datasets/coco8"  # 数据集路径
DATASET_YAML_PATH="coco8.yaml"    # 数据集的配置文件（yaml）路径
ENABLE_DETECTOR=1                 # 是否启动该节点被监测
DETECTOR_HOST="127.0.0.1"        # 检测节点的ip地址
DETECTOR_PORT="5000"             # 检测节点的端口
DETECTOR_PROTOCOL="http"         # 检测节点的协议
MAX_ROUND_OF_FL=2                # 最大联邦学习聚合轮数



# 运行 client.py 并传递所有参数
python ./fl/run.py --eth_protocol $ETH_PROTOCOL --eth_host $ETH_HOST --eth_port $ETH_PORT --ipfs_host $IPFS_HOST --ipfs_port $IPFS_PORT --learning_rate $LEARNING_RATE --batch_size $BATCH_SIZE --min_members $MIN_MEMBERS --dataset_path $DATASET_PATH --dataset_yaml_path $DATASET_YAML_PATH --enable_detector $ENABLE_DETECTOR --detector_host $DETECTOR_HOST --detector_port $DETECTOR_PORT --detector_protocol $DETECTOR_PROTOCOL --max_round_of_FL $MAX_ROUND_OF_FL
